define(function(){
	dmw.Calert =function  (opts){
		var self = this.Calert;
		self.DEFAULT = {
			title:'达美提醒',
			content : "小伙子，你想说啥",
			falseBtn : "取消",
			trueBtn : "确认",
			cancle:function(e){
				alert("取消")
				this.close();
			},
			ok:function(e){
				alert("确认")
				this.close();
			},
			close:function(e){
				$(".dm_shade_box_top").addClass("hide1");
				$(".dm_confirm_alert").remove();
			}
		}
		typeof opts !="object" ? dmw.Calert.DEFAULT.content = opts : 
			self.DEFAULT =  $.extend(self.DEFAULT,self.DEFAULT,opts);
		self.auto = function(){
			if(this.DEFAULT.title == ''){
				var str = this.DEFAULT.content.length >=29 ? "<div class='dm_confirm_alert'><div class='dm_confirm_content dm_confirm_notitle'>"+
				this.DEFAULT.content+"</div><a href='javascript:;' class='dm_confirm_false'>"+
				this.DEFAULT.falseBtn+"</a><a href='javascript:;' class='dm_confirm_true'>"+
				this.DEFAULT.trueBtn+"</a></div>" : "<div class='dm_confirm_alert'><div class='dm_confirm_content dm_confirm_notitle'>"+
				this.DEFAULT.content+"</div><a href='javascript:;' class='dm_confirm_false'>"+
				this.DEFAULT.falseBtn+"</a><a href='javascript:;' class='dm_confirm_true'>"+
				this.DEFAULT.trueBtn+"</a></div>"
			}else {
				var str = "<div class='dm_confirm_alert'><div class='dm_confirm_title'>"+
				this.DEFAULT.title+"</div><div class='dm_confirm_content'>"+
				this.DEFAULT.content+"</div><a href='javascript:;' class='dm_confirm_false'>"+
				this.DEFAULT.falseBtn+"</a><a href='javascript:;' class='dm_confirm_true'>"+
				this.DEFAULT.trueBtn+"</a></div>";
			};
			$(".dm_shade_box_top").removeClass("hide1");
			$("body").append(str);
			this.DEFAULT.content.length < 12 && $(".dm_confirm_alert").css("text-align","center");
			$(".dm_confirm_false").on("click",function(e){
				e.preventDefault();
				return self.DEFAULT.cancle(self);
			})
			$(".dm_confirm_true").on("click",function(e){
				e.preventDefault();
				return self.DEFAULT.ok(self);
			})
		};
		self.auto();
	}
	return dmw.Calert
})